{% extends "common/layout_main.html" %}
{% block content %}
{% include "common/tab_customer.html" %}
<div class="row">
    <div class="col-lg-12">
        <form class="form-inline wrap_search">
            <div class="row  m-t p-w-m">
                <div class="form-group">
                    <select name="sex" class="form-control inline">
                        <option value="-1">请选择性别</option>
                        {% for tmp_key in sex_mapping %}
                            <option value="{{ tmp_key }}" {% if tmp_key == search_con['sex'] %} selected {% endif %}>{{ sex_mapping[ tmp_key ] }}</option>
                        {%  endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <input type="text" name="mix_kw" placeholder="请输入昵称" class="form-control" value="{{ search_con['mix_kw'] }}">
                        <input type="hidden" name="p" value="{{ search_con['p'] }}">
                        <span class="input-group-btn">
                            <button type="button" class="btn  btn-primary search">
                                <i class="fa fa-search"></i>搜索
                            </button>
                        </span>
                    </div>
                </div>
            </div>
            <hr>
        </form>
        <table class="table table-bordered m-t">
            <thead>
            <tr>
                <th width="5%">头像</th>
                <th width="20%">姓名</th>
                <th width="20%">性别</th>
                <th width="10%">状态</th>
                <th width="30%">创建时间</th>
                <th width="15%">操作</th>
            </tr>
            </thead>
            <tbody>
            {%  if list %}
                {% for item in list %}
                    <tr>
                        <td><img alt="image" class="img-circle" src="{{ item.avatar }}" style="width: 100px;height: 100px;"></td>
                        <td>{{ item.nickname }}</td>
                        <td>{%  if item.sex==1 %}男{%else%}女{% endif %}</td>
                        <td>{{ item.status }}</td>
                        <td>{{ item.created_time }}</td>
                        <td>
                            <a href="{{ buildUrl('/customer/info') }}?id={{  item.id }}">
                                <i class="fa fa-eye fa-lg"></i>
                            </a>
                        </td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr><td colspan="5">暂无数据</td></tr>
            {% endif %}
            </tbody>
        </table>
        <!--分页代码已被封装到统一模板文件中-->
        {% include 'common/pagenation.html' %}
    </div>
</div>
{% endblock %}
{%  block js %}
<script src="{{ buildStaticUrl('/js/customer/index.js') }}"></script>
{% endblock %}

